package com.chixing.day10_hashcode_exception;

import com.chixing.day10_hashcode_exception.exception.BalanceNotEnoughException;

import java.sql.SQLException;

public class HandlerExceptionDemo {

    public static void main(String[] args) throws SQLException, BalanceNotEnoughException {
        fun4();
    }

    public static void fun4() {
        Account account = new Account();
        account.setAccBalance(150);

        try {
            System.out.println("try1");
            int a = 10 / 0;
            System.out.println("try2");

        } catch (ArithmeticException e) {
            System.out.println("模拟除数不能为0 处理的逻辑.......");
        }

        System.out.println("xxxxxxxxxxxxxxxxxx");

        try {
            Account.class.getField("").get(null);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }


    }


    public static void fun1() throws SQLException {

    }

    public static void fun2() throws BalanceNotEnoughException {
        fun3();
    }

    public static void fun3() throws BalanceNotEnoughException {

    }
}

